<!DOCTYPE html>
<meta charset="UTF-8">
<div style="padding: 10px;">
	<ul id="tt" data-type="tree"
		data-defs="method:'get',url: '${rc.contextPath}/assets/ui/jww/demo/testdata/tree_data1.json',animate:true,checkbox:true"></ul>
</div>
<div style="margin: 10px 0;">
	<a href="#" data-type="button" data-defs="'width':190" onclick="getChecked()">获得checkbox选择的节点</a>
	<br />
	<input type="checkbox" checked onchange="$('#tt').tree({cascadeCheck:$(this).is(':checked')})">
	父子checkbox联动
	<input type="checkbox" onchange="$('#tt').tree({onlyLeafCheck:$(this).is(':checked')})">
	只有子节点有checkbox
</div>
<script type="text/javascript">
	function getChecked() {
	    var nodes = $('#tt').tree('getChecked');
	    var s = '';
	    for ( var i = 0; i < nodes.length; i++) {
		    if (s != '')
			    s += ',';
		    s += nodes[i].text;
	    }
	    alert(s);
    }
</script>
